<?php

use Zizaco\Entrust\EntrustPermission;

class Permission extends EntrustPermission {

    /**
     * Ardent validation rules
     *
     * @var array
     */
    public static $rules = array (
        'name'         => 'required|between:1,128',
        'display_name' => 'required|between:1,128'
    );

    public function roles() {
        return $this->belongsToMany('Role', 'permission_role', 'permission_id', 'role_id')->withTimestamps()->withPivot('id', 'updater');
    }

}
